package com.getan.boot.module.system.domain.bo;

import com.getan.boot.common.domain.GenericBO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 角色管理
 *
 * @author Bruce.Gong
 * @since 1.0.0-SNAPSHOT
 */
public interface RoleBO {

    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class AddBO extends GenericBO {
        @NotEmpty(message = "角色编码不能为空")
        private String code;
        @NotEmpty(message = "角色名称不能为空")
        private String name;
        private Integer dataScope;
        private String remark;
    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class UpdateBO extends GenericBO {
        @NotNull(message = "ID不能为空")
        private Long id;
        @NotEmpty(message = "角色名称不能为空")
        private String name;
        private Integer dataScope;
        private String remark;
    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class AllocUserBO extends GenericBO {
        @NotNull(message = "角色ID不能为空")
        private Long roleId;
        private List<Long> userIds;
    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class AllocPermissionBO extends GenericBO {
        @NotNull(message = "角色ID不能为空")
        private Long roleId;
        private List<Long> permissionIds;
    }

}
